﻿
Imports System.Data.OleDb

Public Class Contact
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub


    Protected Sub Submit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Submit.Click
        Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("Outletsdb").ConnectionString)

        Dim SqlString As String = "Insert into location(Area,Cuisine,[Meal Type],Email,[Posted By],Comments) Values (?,?,?,?,?,?)"

        Dim cmd As OleDbCommand = New OleDbCommand(SqlString, oleDbConn)

        cmd.CommandType = CommandType.Text

        cmd.Parameters.AddWithValue("Area", Article_Area.Text)
        cmd.Parameters.AddWithValue("Cuisine", Article_Cuisine.Text)
        cmd.Parameters.AddWithValue("Meal Type", Article_MealType.Text)
        cmd.Parameters.AddWithValue("Posted By", Article_PostedBy.Text)
        cmd.Parameters.AddWithValue("Email", Article_Email.Text)
        cmd.Parameters.AddWithValue("Comments", Article_Comments.Text)

        oleDbConn.Open()

        cmd.ExecuteNonQuery()

        Response.Redirect("Location.aspx")
    End Sub

    Protected Sub Article_Postedby_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles Article_PostedBy.TextChanged

    End Sub
End Class